package com.hung.ttest_other;
/**
 * title:ExtendsTestDemo.java
 * author: hungki
 * createTime 18/8/28 上午 9:55
 * version v_1.0
 * Copyright @ 2018 复华创新事业部
 */

/**
 * className: ExtendsTestDemo 
 * describe: 
 * author: hungki  
 * createTime 18/8/28 上午 9:55 
 *
 */
class A{
    public void show(A a){
        System.out.println(" A and A ");
    }
    public void show(D a){
        System.out.println(" A and D ");
    }
}
class B{
    public void show(B a){
        System.out.println(" B and B ");
    }
    public void show(D a){
        System.out.println(" B and D ");
    }
}
class C extends B{}
class D extends B{}

public class ExtendsTestDemo {
    public static void main(String[] args) {
        A a = new A();
        B b = new B();
        C c = new C();
        D d = new D();

        a.show(a);
        a.show(d);
        b.show(b);
        b.show(d);
        c.show(b);
        c.show(d);

    }
}
